package com.fm.controller;

import com.fm.entity.ProductTopic;
import com.fm.service.ProductTopicService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * Created by Administrator on 2018/7/30 0030.
 */
@RestController
@RequestMapping("/api/productTopic")
public class ProductTopicController extends MBaseController<ProductTopic, ProductTopicService>{

    @Override
    public ProductTopic beforeList(Map t) {
        ProductTopic topic = new ProductTopic();
        topic.setProductId(Integer.parseInt((String) t.get("productId")));
        return topic;
    }

    @Override
    public void beforeInsert(ProductTopic topic, HttpServletRequest request) {
        topic.setIsSystem(0);
    }
}
